package com.lu.mapper;

import com.lu.entity.Dormitory;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DormitoryMapper {
    //查询宿舍所有信息
    List<Dormitory> findAllDormitory();

    //添加宿舍数据
    void insertDormitoryData(Dormitory dormitory);

    //根据id查询宿舍数据
    List<Dormitory> findDormitoryById(Integer id);

    //修改宿舍数据
    void updateDormitoryData(Dormitory dormitory);

    //根据id删除宿舍数据
    @Delete("delete from dormitory where id = #{id}")
    void deleteDormitoryById(Integer id);

    //根据传入的寝室号和宿舍楼查询对应的数据
    List<Dormitory> findByNumBud(Dormitory dormitory);
}
